<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterTableProductsAddColumns extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('products', function (Blueprint $table) {
            $table->unsignedTinyInteger('type')->default(0)->comment('菜品类型 0：普通商品 1：套餐')->after('categoryId');
            $table->char('showPlatform')->default(1)->comment('渠道显示 1:POS 2:小程序 保存多个时需把对应数字相加')->after('isRecommend');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table("products", function (Blueprint $table) {
            $table->dropColumn('type');
            $table->dropColumn('showPlatform');
        });
    }
}
